#include "LevelLoaderTest.hpp"
#include "../src/Level.hpp"

LevelLoaderTest::LevelLoaderTest()
{
}
LevelLoaderTest::~LevelLoaderTest()
{
}
        
std::string LevelLoaderTest::name()
{
    return "LevelLoader test";
}

bool LevelLoaderTest::test()
{
    Level l;
    // test, it can loads correctly a level
    try   
    {
        l.loadFromFile("test.lvl");
    }
    catch(...)
    {
        return false;
    }
    
    // test, it can spots errors
    try
    {
        l.loadFromFile("incorrect.lvl");
        return false;
    }
    catch(...)
    {
    }
    
    // test, it can handle invalid fileName
    try
    {
        l.loadFromFile("incorrect.lvl");
        return false;
    }
    catch(...)
    {
    }    
    return true;
}

    

